<?php

class FrontendController extends Zend_Controller_Action {

	public function init() {
		$compress = (bool)Zend_Registry::get('appConfig')->resources->layout->params->compress;
		$this->_helper->viewRenderer->setNoRender(true);
		$packages = new ViewPackages_PackageCreator('css', 'js/compressed');
		if($compress) {
			$packages->init();
			$this->view->cssFiles = $packages->getCssFiles();
			$this->view->jsFiles = $packages->getJsFiles();
		}
		else {
			$this->view->cssFiles = $packages->getOriginalCssFiles();
			$this->view->jsFiles = $packages->getOriginalJsFiles();
		}
	}

	public function indexAction() {
		$this->_redirect('/empeval');
		if (!Core_Auth::getInstance()->isAuth()) {
			$authResult = Core_Auth::getInstance()->setLogin('Adam')->authenticate();
			if (!$authResult->isValid()) {
				Zend_Debug::dump($authResult->getMessages());
				die;
			}
		}
	}

}